<template>
  <my-table listPath="permission/page" savePath="permission/save" deletePath="permission/delete" :table="table" :pageParams="pageParams" :rules="rules" dialogTitle="对话框" :pageSize="[5,10,20,35,50]" :dialogForm="form">
    <template v-slot:dialogSlot>
      <el-form-item label="权限名称" prop="name">
          <el-input v-model="form.name" clearable></el-input>
      </el-form-item>
      <el-form-item label="权限代码" prop="code">
          <el-input v-model="form.code" clearable></el-input>
      </el-form-item>
      <el-form-item label="排序" prop="name">
            <el-input-number v-model="form.idx1" style="width: 100%;" controls-position="right" :min="1"></el-input-number>
      </el-form-item>
    </template>
  </my-table>
</template>

<script>
  import myTable from '../../components/myTableszxt.vue';
  export default{
    name:'premission',
    components:{myTable},
    data() {
      return {
       pageParams:{
            limit:10,
            page:1,
            sort:'id',
            order:'asc',
            search:''
        }
        ,
        form:{
          name:'',
          code:'',
          idx1:''
        },
        table:[

          {
            title:'编号',
            field:'id'
          },

          {
            title:'权限名称',
            field:'name'
          },
          {
            title:'编码',
            field:'code'
          },
          {
            title:'排序',
            field:'idx1'
          },


        ],
        rules:{
              name: [{ required: true, message: '请输入权限名称', trigger: 'blur' }],
              code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
              name: [{ required: true, message: '请输入排序', trigger: 'blur' }],
        },

      }
    },
    methods:{
      handleChange(val){
        if(val==undefined){
          this.form.idx1=1;
        }
      },
    }
    }
</script>

<style>
</style>
